Script crashes DOORS in 9.1, but not in 8.3

I am working on fixing a script that scans a project and gets each module's last modified date and user and puts them in an excel spreadsheet. The issue is that in 9.1 it'll crash after a certain amount of time (this time doesn't vary much), where in 8.3 the script doesn't have an issue. I've tried adding pragma runLim, 0 and it hasn't helped. Any suggestions would be helpful
SystemAdmin - Wed Feb 25 13:34:32 EST 2009

Re: Script crashes DOORS in 9.1, but not in 8.3
ePiallat - Thu Feb 26 04:34:32 EST 2009

Hi,

My guts tell the issue doesn't come from your script, but from the scanned data:
How do you access the "Last Modified On" attribute?
If it is from "Module", it means while opening modules you fire triggers, DXL attribute computing and perhaps Layout DXL.
If it is from "ModuleProperties" or "Module", you still fire module-level DXL attribute computing.

In any case, can you tell for sure your migrated modules are clean?
Another theory would be a memory leak. Use of "ModuleProperties" seems to have such an issue, but as its behaviour differs from a version to another I can't confirm it with DOORS 9.1 myself.

– Éric

Re: Script crashes DOORS in 9.1, but not in 8.3
SystemAdmin - Fri Feb 27 10:18:31 EST 2009

ePiallat - Thu Feb 26 04:34:32 EST 2009
Hi,

My guts tell the issue doesn't come from your script, but from the scanned data:
How do you access the "Last Modified On" attribute?
If it is from "Module", it means while opening modules you fire triggers, DXL attribute computing and perhaps Layout DXL.
If it is from "ModuleProperties" or "Module", you still fire module-level DXL attribute computing.

In any case, can you tell for sure your migrated modules are clean?
Another theory would be a memory leak. Use of "ModuleProperties" seems to have such an issue, but as its behaviour differs from a version to another I can't confirm it with DOORS 9.1 myself.

– Éric

Here's the code that is causing the issue:

for itm in current Project do
{
progressStep ++cnt
if (progressCancelled)
{
if (confirm("Halt Progress?"))
{
progressStop
CleanUp
halt
}
}
if (type(itm) == "Project")
{
csvfile << "Project," name(itm) ",,,\n"
}
if (type(itm) == "Folder")
{
csvfile << "Folder," name(itm) ",,,\n"
}
if (type(itm) == "Formal")
{
modN = fullName(itm)
m = read(modN, false)
if (m != null)
{
lastModOn = m."Last Modified On"
lastModBy = m."Last Modified By"
if (existsUser(lastModBy))
{
u = find(lastModBy)
uName = u.fullName
if (uName == null)
{
uName = lastModBy
}
}
else
{
uName = "Unknown User"
}
csvfile << "Formal Module," name(itm) "," lastModOn "," uName ",\n"
}
else
{
csvfile << "ERROR!, Formal Module, Could Not, Be Opened,\n"
cantopen++
}
}
else
{
//No Output
}
}
I'm not sure what you mean by migrated modules being clean. Also, how can I check if triggers are causing this issue?

Re: Script crashes DOORS in 9.1, but not in 8.3
SystemAdmin - Fri Feb 27 10:51:33 EST 2009

SystemAdmin - Fri Feb 27 10:18:31 EST 2009
Here's the code that is causing the issue:

for itm in current Project do
{
progressStep ++cnt
if (progressCancelled)
{
if (confirm("Halt Progress?"))
{
progressStop
CleanUp
halt
}
}
if (type(itm) == "Project")
{
csvfile << "Project," name(itm) ",,,\n"
}
if (type(itm) == "Folder")
{
csvfile << "Folder," name(itm) ",,,\n"
}
if (type(itm) == "Formal")
{
modN = fullName(itm)
m = read(modN, false)
if (m != null)
{
lastModOn = m."Last Modified On"
lastModBy = m."Last Modified By"
if (existsUser(lastModBy))
{
u = find(lastModBy)
uName = u.fullName
if (uName == null)
{
uName = lastModBy
}
}
else
{
uName = "Unknown User"
}
csvfile << "Formal Module," name(itm) "," lastModOn "," uName ",\n"
}
else
{
csvfile << "ERROR!, Formal Module, Could Not, Be Opened,\n"
cantopen++
}
}
else
{
//No Output
}
}
I'm not sure what you mean by migrated modules being clean. Also, how can I check if triggers are causing this issue?

I've isolated the issue to this line:
m = read(modN, false)

I've also added a close(m) after the attribute information was gathered, and it did not fix the issue. Why is this read causing the script to fail even if I'm closing the modules afterwards? Also, is there a way to get attribute information without doing this read?

Re: Script crashes DOORS in 9.1, but not in 8.3
ePiallat - Fri Feb 27 11:13:50 EST 2009

SystemAdmin - Fri Feb 27 10:51:33 EST 2009
I've isolated the issue to this line:
m = read(modN, false)

I've also added a close(m) after the attribute information was gathered, and it did not fix the issue. Why is this read causing the script to fail even if I'm closing the modules afterwards? Also, is there a way to get attribute information without doing this read?

Did it crash always on the same module opening?
(Does your log file always end at the same line?)

In this case, try to just open the presummably faulty module (last listed in log file).
You will then be able to list every embedded DXL with:

Trigger t; for t in current Module do print (name of t) ":\\n" (dxl of t) "\\n==========================================\\n"

AttrDef ad; for ad in current Module do if (ad.dxl) print (ad.name) ":\\n" (string ad.dxl) "\\n==========================================\\n"

Re: Script crashes DOORS in 9.1, but not in 8.3
ePiallat - Fri Feb 27 11:36:26 EST 2009

SystemAdmin - Fri Feb 27 10:51:33 EST 2009
I've isolated the issue to this line:
m = read(modN, false)

I've also added a close(m) after the attribute information was gathered, and it did not fix the issue. Why is this read causing the script to fail even if I'm closing the modules afterwards? Also, is there a way to get attribute information without doing this read?

/* You may also not read your modules at all by replacing: */
modN = fullName(itm)
m = read(modN, false)
if (m != null)
{
lastModOn = m."Last Modified On"
lastModBy = m."Last Modified By"
/*
by:
*/
modN = fullName(itm)
ModuleProperties mp
getProperties (moduleVersion module modN, mp)
if (mp != null)
{
lastModOn = probeRichAttr_ (mp,"Last Modified On", false)
lastModBy = probeRichAttr_ (mp,"Last Modified By", false)

/* – Éric */

Re: Script crashes DOORS in 9.1, but not in 8.3
SystemAdmin - Fri Feb 27 12:11:41 EST 2009

The last suggestion on using Module Properties solved the issue. Thanks